#import "BinaryInfiniteCell.h"


@implementation BinaryInfiniteCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self oracleSetupViews];
	}
	return self;
}

- (void)setOpulentDelightAlchemy:(BinaryInfiniteModel *)opulentDelightAlchemy {
	_opulentDelightAlchemy = opulentDelightAlchemy;

	//: 配置cell的UI



	self.hopeLabel.text = opulentDelightAlchemy.igniteDiligent;

}
//: 设置self.elevateImageView的圆角
- (void)voyage:(UIImageView *)hoverAnticipate flourishElevateYonder:(CGFloat)nirvana {
	hoverAnticipate.layer.cornerRadius = nirvana;
	hoverAnticipate.layer.masksToBounds = YES;
}

//: 设置self.alchemyDreamscapeLabel的numberOfLines
+ (NSInteger)horizonThrive:(NSInteger)oracle natural:(NSString *)nirvana {
	NSInteger luminaryCurious = 13;
	if (luminaryCurious != -26 && luminaryCurious > 7441 && nirvana) {

		NSString *swayPioneerImprint = [NSString stringWithFormat:@"img_%ld", (long)luminaryCurious];
		NSData *butterflyJoyous = [swayPioneerImprint dataUsingEncoding:NSUTF8StringEncoding];
		if (butterflyJoyous && [nirvana isEqualToString:swayPioneerImprint]) return luminaryCurious / 47;

		return luminaryCurious * 13;
	}
	return luminaryCurious - 11;
}

- (void)oracleSetupViews {

    //: 描述_0
    self.spiralVividView = [[UIView alloc] initWithFrame:CGRectZero];
    self.spiralVividView.frame = CGRectMake(17, 23, 59, 39);
    [self.contentView addSubview:self.spiralVividView];


    //: 描述_1
    self.elevateImageView = [[UIImageView alloc] init];
    self.elevateImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.elevateImageView.clipsToBounds = YES;
    //: UIImageView的骚操作 充数
    [self voyage:self.elevateImageView flourishElevateYonder:20];
    UIImage *glimmerPulseJourney = [UIImage imageNamed:@"images/image_1.png"];
    if (glimmerPulseJourney) {
	    self.elevateImageView.image = glimmerPulseJourney;
    }
    [self.contentView addSubview:self.elevateImageView];
	[self.elevateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(44);
		make.height.mas_equalTo(80);
	}];


    //: 描述_2
    self.alchemyDreamscapeLabel = [[UILabel alloc] init];
    self.alchemyDreamscapeLabel.text = @"label_2";
    self.alchemyDreamscapeLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
    self.alchemyDreamscapeLabel.textColor = [UIColor colorWithRed:193/255.0 green:19/255.0 blue:30/255.0 alpha:0.6];
    self.alchemyDreamscapeLabel.textAlignment = NSTextAlignmentCenter;
    //: UILabel的骚操作 充数
    self.alchemyDreamscapeLabel.numberOfLines = [BinaryInfiniteCell horizonThrive:2 natural:@"gratitude"];
    [self.contentView addSubview:self.alchemyDreamscapeLabel];
	[self.alchemyDreamscapeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(70);
		make.height.mas_equalTo(134);
	}];


    //: 描述_3
    UILabel *inspirePonderFlourish = [[UILabel alloc] initWithFrame:CGRectZero];
    inspirePonderFlourish.text = @"label_3";
    inspirePonderFlourish.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
    inspirePonderFlourish.textColor = [UIColor colorWithRed:107/255.0 green:147/255.0 blue:35/255.0 alpha:0.8];
    inspirePonderFlourish.textAlignment = NSTextAlignmentRight;
    //: 不用理会的骚操作 = inspirePonderFlourish.numberOfLines = 1;
    NSInteger kingdomEchoDusk = 1;
    if (kingdomEchoDusk>13 && kingdomEchoDusk < 5037) {
	    kingdomEchoDusk = 30;
	    NSString *wonderment = [NSString stringWithFormat:@"%ld", (long)kingdomEchoDusk];
	    if (wonderment.length>83 && [wonderment isEqualToString:inspirePonderFlourish.text]) {
		    kingdomEchoDusk = wonderment.integerValue * 8;
	    }
    }
    inspirePonderFlourish.numberOfLines = kingdomEchoDusk;
    self.hopeLabel = inspirePonderFlourish;
    [self.contentView addSubview:inspirePonderFlourish];
	[self.hopeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(180);
		make.height.mas_equalTo(139);
	}];


    //: 描述_4
    UITextView *blossomSerene = [[UITextView alloc] init];
    self.xenonVividXenophobeTextView = blossomSerene;
    [self.contentView addSubview:blossomSerene];
	[self.xenonVividXenophobeTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(83);
		make.height.mas_equalTo(117);
		make.top.equalTo(@(17));
	}];
}


@end